package cn.edu.bit.snake;

import java.awt.*;

public class Fruit {
	public static final int FRUIT_WIDTH = 15;
	public static final int FRUIT_HEIGHT = 15;
	
	
	private int x,y;
	private SnakeClient sc  = null;


	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	
	
	public Fruit(int x,int y, SnakeClient sc){
		this.x = x;
		this.y = y;
		this.sc = sc;
	}
	
	
	public void draw(Graphics g){
		Color c = g.getColor();
		g.setColor(Color.BLUE);
		g.fillRect(x, y, FRUIT_WIDTH, FRUIT_HEIGHT);
		g.setColor(c);
	}
	
	public Rectangle getRectangle(Fruit f){
		return new Rectangle(f.getX(), f.getY(), Fruit.FRUIT_WIDTH, Fruit.FRUIT_HEIGHT);
	}
}
